//
//  ZYSalaryOrder.m
//  DesignMode
//
//  Created by wangzhipan on 2024/9/9.
//

#import "ZYSalaryOrder.h"
#import "SalaryStrategy.h"
#import "SalaryContent.h"

@interface ZYSalaryOrder()
@property (nonatomic, strong, nullable) id<ISalaryCalculate> salary;
@end

@implementation ZYSalaryOrder
- (instancetype)initWithSalary:(id<ISalaryCalculate>)salary
{
    if (self = [super init]) {
        self.salary = salary;
    }
    return self;
}

- (double)salaryCalculate
{
    SalaryContent *content = [[SalaryContent alloc] init];
    content.base = 10000;
    content.rate = 0.8;
    content.patent = 2000;
    return [self.salary salaryCalculateWithContent:content];
}
@end
